New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pluginjs/classes

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/classes

A flexible modern classes js plugin.

  • 0.7.20
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
126
increased by106.56%
Maintainers
2
Weekly downloads
 
Created
Source

Classes

npm package

classes is a utility JavaScript library for control class interfaces.

Introduction

Installation

Yarn
yarn add @pluginjs/classes
NPM
npm i @pluginjs/classes

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/classes/dist/classes.js"></script>

Production:

<script src="https://unpkg.com/@pluginjs/classes/dist/classes.min.js"></script>

API

addClass

Add specified class values. If these classes already exist in attribute of the element, then they are ignored.

Parameters

| Name | Type | Description | |||-| | className | String[] | function rest parameter |

Returns

| Name | Type | Description | |||-| | element | HTMLElement | |

removeClass

Remove specified class values.

Parameters

| Name | Type | Description | |||-| | className | String[] | function rest parameter |

Returns

| Name | Type | Description | |||-| | element | HTMLElement | |

indexOfClass

Return class value by index in collection.

Parameters

| Name | Type | Description | |||-| | className | String | | | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | index | Number | index of class |

hasClass

Checks if specified class value exists in class attribute of the element.

Parameters

| Name | Type | Description | |||-| | className | String | | | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | hasClass | Boolean | |

toggleClass

Toggle class value; i.e., if class exists then remove it and return false, if not, then add it and return true.

Parameters

| Name | Type | Description | |||-| | className | String | | | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | element | HTMLElement | |

Browser support

Tested on all major browsers.

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

License

@pluginjs/classes is Licensed under the GPL-v3 license.

If you want to use @pluginjs/classes project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright (C) 2018 Creation Studio Limited.

FAQs

Package last updated on 15 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc